package org.khd.gift.fallback;

import feign.hystrix.FallbackFactory;
import org.khd.gift.clients.AuthClient;
import org.khd.gift.util.AjaxResult;
import org.springframework.stereotype.Component;

@Component
public class AuthClientFallback implements FallbackFactory<AuthClient> {
    @Override
    public AuthClient create(Throwable throwable) {
        throwable.printStackTrace();
        return loginUser -> AjaxResult.me().setSuccess(false).setMessage("网络异常，请稍后刷新重试!");
    }
}
